package com.base.cn.platform.os.controller.course.mould;

import com.base.cn.platform.os.common.controller.BaseController;
import com.base.cn.platform.os.common.utils.result.ResultUtil;
import com.base.cn.platform.os.service.course.mould.CouMouldMaterialBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Map;
/**
 * 模块关联素材的Controller
 *
 * @author s.li
 * @create 2018-04-25-9:45
 */
@RestController
@RequestMapping("/course")
public class MouldMaterialController extends BaseController {
    @Autowired
    private CouMouldMaterialBiz couMouldMaterialBiz;

    /**
     * 保存模块与素材的关联
     * @param mouldId 模块ID
     * @param materialIds 素材的ID串
     * @return Map<String,Object>
     */
    @RequestMapping("/saveCouMouldMaterial")
    public Map<String,Object> saveCouMouldMaterial(@RequestParam("mouldId") BigDecimal mouldId,
                                                   @RequestParam("materialIds") String materialIds){
        couMouldMaterialBiz.saveCouMouldMaterial(mouldId,materialIds);
        return ResultUtil.SUCCESS("设置模块素材成功");
    }
}
